Skip to content

feat: SQDSDKS-7423 - Add event mapping functionality and new MPRoktEventMapper class#16

Merged
BrandonStalnaker merged 5 commits into
developmentfrom
feat/SQDSDKS-7423-events-api-subscription
Jun 20, 2025
Merged

feat: SQDSDKS-7423 - Add event mapping functionality and new MPRoktEventMapper class#16
BrandonStalnaker merged 5 commits into
developmentfrom
feat/SQDSDKS-7423-events-api-subscription

Conversation

@thomson-t

Copy link
Copy Markdown
Collaborator

Instructions

  1. PR target branch should be against development
  2. PR title name should follow this format: https://github.com/mParticle/mparticle-workflows/blob/main/.github/workflows/pr-title-check.yml
  3. PR branch prefix should follow this format: https://github.com/mParticle/mparticle-workflows/blob/main/.github/workflows/pr-branch-check-name.yml

Summary

  • Introduced MPRoktEventMapper class for mapping Rokt events to mParticle events.
  • Added methods in MPKitRokt for handling events with identifiers and global events.
  • Updated podspec to include Swift source files and public header files.

Testing Plan

  • Was this tested locally? If not, explain why.
  • Tested locally but need to add unit tests to cover the new APIs

Reference Issue (For mParticle employees only. Ignore if you are an outside contributor)

…entMapper class

- Introduced MPRoktEventMapper class for mapping Rokt events to mParticle events.
- Added methods in MPKitRokt for handling events with identifiers and global events.
- Updated podspec to include Swift source files and public header files.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Adds a new event mapping layer between Rokt and mParticle and exposes handler methods, along with project and podspec updates to include Swift sources.

  • Introduces MPRoktEventMapper for converting RoktEvent instances to MPRoktEvent
  • Adds eventsWithIdentifier:onEvent: and globalEventsOnEvent: in MPKitRokt
  • Updates Xcode project settings and Podspec to register the new Swift files and headers

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
mParticle-Rokt/MPRoktEventMapper.swift New Swift utility for mapping Rokt events
mParticle-Rokt/MPRoktEventMapper.h Obj-C header for the mapper class
mParticle-Rokt/MPKitRokt.m Added identifier-based and global event APIs
mParticle-Rokt.xcodeproj/project.pbxproj Registered Swift sources and headers in the project
mParticle-Rokt.podspec Expanded source_files to include Swift and headers
Comments suppressed due to low confidence (3)

mParticle-Rokt/MPKitRokt.m:300

  • This newly added public method lacks a documentation comment. Please add a docblock explaining its purpose, parameters, and return value.
- (MPKitExecStatus *)eventsWithIdentifier:(NSString *)identifier onEvent:(void (^)(MPRoktEvent * _Nonnull))onEvent {

mParticle-Rokt/MPRoktEventMapper.swift:10

  • The mapEvent(_:) method covers many event cases but lacks unit tests. Consider adding tests to verify each mapping branch.
    @objc public static func mapEvent(_ event: RoktEvent) -> MPRoktEvent? {

mParticle-Rokt/MPRoktEventMapper.h:10

  • The method declaration uses '++' instead of a single '+', causing a syntax error. Change it to '+' for a valid class method declaration.
+ (nullable id<MPRoktEvent>)mapEvent:(RoktEvent *)event;

isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
B3D778532E02845700D887A4 /* MPRoktEventMapper.swift in Sources */,

Copilot AI Jun 18, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MPRoktEventMapper.swift is listed twice under PBXSourcesBuildPhase, leading to duplicate file references. Remove the extra entry.

Suggested change
B3D778532E02845700D887A4 /* MPRoktEventMapper.swift in Sources */,

Copilot uses AI. Check for mistakes.
Comment thread mParticle-Rokt.podspec
@@ -15,7 +15,8 @@ Pod::Spec.new do |s|
s.swift_version = '5.3'

Copilot AI Jun 18, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The podspec declares Swift version '5.3' but the Xcode project is set to Swift 6.0. Align the podspec swift_version with the project to avoid compatibility issues.

Suggested change
s.swift_version = '5.3'
s.swift_version = '6.0'

Copilot uses AI. Check for mistakes.
@thomson-t thomson-t marked this pull request as ready for review June 19, 2025 09:27
@thomson-t thomson-t force-pushed the feat/SQDSDKS-7423-events-api-subscription branch from 11b791c to 2a38817 Compare June 19, 2025 12:54

@BrandonStalnaker BrandonStalnaker left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code looks good for now (I know you said you have more changes planned) but please make sure to test through an app that uses cocaopods.

FOUNDATION_EXPORT double mParticle_RoktVersionNumber;
FOUNDATION_EXPORT const unsigned char mParticle_RoktVersionString[];

#if defined(__has_include) && __has_include(<mParticle_Appboy/MPKitAppboy.h>)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please test this in an app that uses cocaopods to integrate the frameworks. I know this isn't need when clients use SPM but it is for cocaopods clients

@BrandonStalnaker BrandonStalnaker merged commit 73d0eaf into development Jun 20, 2025
4 checks passed
@BrandonStalnaker BrandonStalnaker deleted the feat/SQDSDKS-7423-events-api-subscription branch June 20, 2025 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants